<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/8/2
  Time: 11:02
  To change this template use File | Settings | File Templates.
--%>
<%--1. 引入方式一：使用CDN方式引入--%>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<%--<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">--%>
<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
<%--<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">--%>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<%--<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>--%>


<%--2. 引入方式二：使用webjars方式引入--%>
<link rel="stylesheet" href="webjars/bootstrap/3.4.1/dist/css/bootstrap.min.css">
<script src="webjars/jquery/3.6.0/dist/jquery.min.js"></script>
<script src="webjars/bootstrap/3.4.1/dist/js/bootstrap.min.js"></script>

<%--3. 使用idea中bootstrap插件的快捷键：bs3 + （快捷键：ctrl + j ）--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>购物车列表展示</title>
    <style>
        .container{
            margin-top: 20px;
        }
        .table{
            text-align: center;
        }
    </style>
</head>
<body>
<div class="container">

    <div class="panel panel-primary">
        <!-- Default panel contents -->
        <div class="panel-heading">购物车列表</div>

    <table class="table table-bordered table-striped table-hover">
        <tr>
            <td>商品ID</td>
            <td>商品名称</td>
            <td>商品单价</td>
            <td>商品数量</td>
            <td>小计</td>
            <td>操作</td>
        </tr>
        <c:forEach items="${cart.map}" var="p">
            <tr>
                <td>${p.value.product.pid}</td>
                <td>${p.value.product.pname}</td>
                <td>${p.value.product.price}</td>
                <td>${p.value.num}</td>
                <td>${p.value.total}</td>
                <td>
                    <a href="/cart?cmd=remove&pid=${p.value.product.pid}"  class="btn btn-danger btn-sm" >移除</a>
                </td>
            </tr>
        </c:forEach>
        <tr>
            <td colspan="6">
                <a href="/" class="btn btn-primary btn-sm">返回继续购物</a>
                <a href="/cart?cmd=clear" class="btn btn-warning btn-sm">清空购物车</a>
            </td>
        </tr>
    </table>
        <div class="panel-footer text-right">
            百年智集团2000-2022.
        </div>
    </div>
</div>

</body>
</html>
